﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- 于庆海  -->
    <meta charset="UTF-8"/>
    <title>流程轨迹查看权限</title>
    <script language="JavaScript" src="../../Comm/JScript.js" type="text/javascript" ></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
     <base target="_self" /> 
    <link href="../../Comm/Style/Table0.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/config.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Comm/Gener.js"></script>

    <script language="javascript" type="text/javascript" >
        /* ESC Key Down */
        function Esc() {
            if (event.keyCode == 27)
                window.close();
            return true;
        }
        function WinOpen(url, name) {
            window.open(url, name, 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no');
            //window.open(url, 'xx');
        }
        function TROver(ctrl) {
            ctrl.style.backgroundColor = 'LightSteelBlue';
        }

        function TROut(ctrl) {
            ctrl.style.backgroundColor = 'white';
        }
        function ShowHidden(ctrlID) {

            var ctrl = document.getElementById(ctrlID);
            if (ctrl.style.display == "block") {
                ctrl.style.display = 'none';
            } else {
                ctrl.style.display = 'block';
            }
        }
        //页面启动函数.
        $(function () {

            $("#Msg").html("<img src=../../Img/loading.gif />&nbsp;正在加载,请稍后......");

            InitPage();

            $("#Msg").html("");
        });
        //初始化数据.
        function InitPage() {

            var fk_flow = GetQueryString("FK_Flow");

            //初始化表格.
            $.ajax({
                type: 'post',
                async: true,
                url: Handler + "?DoType=TruckViewPower_Init&FK_Flow=" + fk_flow + "&m=" + Math.random(),
                dataType: 'html',
                success: function (data) {

                    if (data.indexOf('err@') == 0) {
                        alert(data);
                        return;
                    }
                    data = JSON.parse(data);
                    //调用公共类库的方法:执行批量主表赋值
                    GenerFullAllCtrlsVal(data);
                    return;
                }
            });
        }


        //ajax 提交
        function onSave() {
            var checkBoxIDs = GenerCheckIDs(); //获得所有的 checkBox ID传入到后台去,用于解决checkbox控件，在没有被选择的时候，没有值的问题。
            var frmData = $("#cc").serialize();
            //alert(frmData);
            $.ajax({
                data: frmData,
                type: 'post',
                async: true,
                url: Handler + "?DoType=TruckViewPower_Save&CheckBoxIDs=" + checkBoxIDs + "&FK_Flow=" + GetQueryString("FK_Flow") + "&m=" + Math.random(),
                dataType: 'html',
                success: function (data) {
                    if (data.indexOf('err@') >= 0) {
                        //$("#Msg").html("<font color=red>" + data + "</font>");
                        alert(data);
                        return;
                    }
                    alert(data);
                    //var no = $('#TB_No').val();
                    //window.location.href = 'Student.htm?No=' + no;
                    window.location.href = window.location.href;
                    return;
                }
            });
        }  
     </script>
</head>
<body onkeypress="Esc()" >
<form id="cc">
<table style=" width:100%; padding-left:19px;" >
<caption>流程轨迹查看权限</caption>

 
<tr>
<td colspan="1"  valign="top" rowspan="9" style="width:25%;">

<fieldset> 
<legend>帮助</legend>
<ol>
<li>该设置为了控制该流程的流程实例是可以被那些范围的人可查询，可见。</li>
<li>该控制在工作流程查看器里校验，就是说在操作员要打开工作查看器的时候检查当前的人员是否有权限查看该流程。</li>
<li>与流程相关的人员是必选项，也就是说，流程相关的人员是可以查看轨迹图的，</li>
</ol>

</fieldset>

</td>

<th colspan="4">必选项</th>

</tr>

<tr>
<td> 
    <input type="checkbox" ID="CB_PStarter" name="CB_PStarter"/><label for="CB_PStarter">发起人可见</label> </td>
<td>
    <input type="checkbox" ID="CB_PWorker" name="CB_PWorker"/><label for="CB_PWorker">参与人可见</label> </td>
<td>
    <input type="checkbox" ID="CB_PCCer" name="CB_PCCer"/><label for = "CB_PCCer">被抄送人可见</label></td>
<td>
     </td>
</tr>

<tr>
<th colspan="4"> 按照部门划分 </th>
</tr>

<tr>
<td> 
    <input type="checkbox" ID="CB_PMyDept" name="CB_PMyDept"  /> <label for="CB_PMyDept">本部门人可看 </label>
    </td>
<td>
     <input type="checkbox" ID="CB_PPMyDept" name="CB_PPMyDept"  /><label for="CB_PPMyDept">直属上级部门可看(比如:我是)</label>
    </td>
<td>
     <input type="checkbox" ID="CB_PPDept" name="CB_PPDept"/><label for="CB_PPDept"> 上级部门可看</label>
    </td>
<td>
   <input type="checkbox" ID="CB_PSameDept" name="CB_PSameDept" /> <label for="CB_PSameDept">平级部门可看</label>
    </td> 
</tr>

<tr>
<td> 
    <input type="checkbox" ID="CB_PSpecDept"  name="CB_PSpecDept"  /><label for="CB_PSpecDept">指定的部门可见</label> </td>
<td colspan="3">
    部门编号&nbsp&nbsp<input type=text ID="TB_PSpecDeptExt" name="TB_PSpecDeptExt" />
      </td>
</tr>

<tr>
<th colspan="4">按照其他方式指定 </th>
</tr>


<tr>
<td> <input type="checkbox" ID="CB_PSpecSta" name="CB_PSpecSta"  /><label for="CB_PSpecSta"> 指定的岗位可见 </label></td>
<td colspan="3">
    岗位编号&nbsp&nbsp<input type=text ID="TB_PSpecStaExt" name="TB_PSpecStaExt" />
      </td>
</tr>

<tr>
<td>  <input type="checkbox" ID="CB_PSpecGroup" name="CB_PSpecGroup"  /> <label for="CB_PSpecGroup">指定的权限组可看</label> </td>
<td colspan="3">
    权限组&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type=text ID="TB_PSpecGroupExt" name="TB_PSpecGroupExt" />
      </td>
</tr>

<tr>
<td> <input type="checkbox" ID="CB_PSpecEmp" name="CB_PSpecEmp"   /> <label for="CB_PSpecEmp">指定的人员可看 </label></td>
<td colspan="3">
    指定人员编号&nbsp&nbsp&nbsp<input type=text ID="TB_PSpecEmpExt" name="TB_PSpecEmpExt" />
      </td>
</tr>
</table>

<div style=" text-align:center">
    <input type="button" ID="Btn_Save"  value="保存" onclick="onSave()" />
</div>
</form>
</body>
<script type="text/javascript">
    //动态修改参数
//    $("#dtsbt a").click(function () {
//        $(this).attr("href", $(this).attr('href').replace('flowNo', GetQueryString("FK_Flow")));
//        $(this).attr("href", $(this).attr('href').replace('userId', userId));
//    });
</script>
</html>
